using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Cookie_Hero.testing;

namespace Cookie_Hero
{
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        // definieren van variablen
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;
        //Menu menu;
        //Level level;
        Testing tester;

        public enum GameState
        {
            Menu, Score, LevelPlatformer, LevelFarmville, LevelSpecial
        }
        GameState gameState = GameState.Menu, previousState;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            //graphics.SynchronizeWithVerticalRetrace = false;
            //IsFixedTimeStep = false;
            this.Window.AllowUserResizing = true;
            //graphics.IsFullScreen = true;
        }

        protected override void Initialize()
        {
            Content.RootDirectory = "Content";
            //menu = new Menu(Content, spriteBatch);
            tester = new Testing(this, Content, graphics);
            tester.Initialize();
            base.Initialize();
        }

        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
        }

        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }

        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            tester.Update(gameTime);
            switch (gameState)
            {
                case GameState.Menu:
                    //menu.update(gameTime);
                    break;
            }

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            tester.Draw(spriteBatch);
            //menu.draw(spriteBatch);
            base.Draw(gameTime);
        }
    }
}
